package com.by.entity;

import com.baomidou.mybatisplus.annotation.*;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.experimental.Accessors;

import java.math.BigDecimal;
import java.util.List;

@Data
@ApiModel("spu")
@TableName
@Accessors(chain = true)  //链式
public class Spu {
    /**
     * spu id
     */
    @TableId(value = "spu_id", type = IdType.AUTO)
    @ApiModelProperty(value = "spu id")
    private Integer spuId;
    /**
     * 品牌ID
     */
    @ApiModelProperty(value = "品牌ID")
    private Integer brandId;
    /**
     * 分类ID
     */
    @ApiModelProperty(value = "分类ID")
    private Integer categoryId;
    /**
     * 店铺分类ID
     */
    @ApiModelProperty(value = "店铺分类ID",hidden = true)
    private int shopCategoryId;
    /**
     * 店铺id
     */
    @ApiModelProperty(value = "店铺id",hidden = true)
    private int shopId;
    /**
     * 商品名称
     */
    @ApiModelProperty(value = "商品名称")
    private String name;
    /**
     * 卖点
     */
    @ApiModelProperty(value = "卖点")
    private String sellingPoint;
    /**
     * 商品介绍主图
     */
    @ApiModelProperty(value = "商品介绍主图")
    private String mainImgUrl;
    /**
     * 商品图片 多个图片逗号分隔
     */
    @ApiModelProperty(value = "商品图片 多个图片逗号分隔")
    private String imgUrls;
    /**
     * 商品视频
     */
    @ApiModelProperty(value = "商品视频")
    private String video;
    /**
     * 售价，整数方式保存
     */
    @ApiModelProperty(value = "售价，整数方式保存")
    private BigDecimal priceFee;
    /**
     * 市场价，整数方式保存
     */
    @ApiModelProperty(value = "市场价，整数方式保存")
    private BigDecimal marketPriceFee;
    /**
     * 状态 -1:删除, 0:下架, 1:上架
     */
    @ApiModelProperty(value = "状态 -1:删除, 0:下架, 1:上架")
    private int status;
    /**
     * sku是否含有图片 0无 1有
     */
    @ApiModelProperty(value = "sku是否含有图片 0无 1有")
    private int hasSkuImg;
    /**
     * 序号
     */
    @ApiModelProperty(value = "序号")
    private int seq;
    @ApiModelProperty(value = "添加人id",hidden = true)
    int userId;
    @ApiModelProperty(value = "添加人名称",hidden = true)
    String userName;


    @TableField(exist = false)
    List<Sku> skuList;

    @TableField(exist = false)
    List<Attr> attrs;
    /**
     * 商品详情
     */
    @ApiModelProperty(value = "商品详情")
    @TableField(exist = false)
    String detail;

    @TableField(exist = false)
    List<SpuSkuAttrValue> spuSkuAttrValues;
}
